package de.karlNet.sambamanager.ldapController.commands;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Controller;

import de.karlNet.sambamanager.ldapController.commands.attributeBuilder.ARecordBuilder;
import de.karlNet.sambamanager.ldapModel.dns.LdapDNSARecord;

@Controller
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public class CreateARecord extends BaseCommand {
	@Autowired
	private ARecordBuilder aRecordBuilder;

	public void createARecordItself(LdapDNSARecord ldapDNSARecord) {
		this.ldapTemplate.bind(ldapDNSARecord.getDn(), null,
				this.aRecordBuilder.buildARecordAttributesWithDC(ldapDNSARecord));
	}
}
